<template>
  <div>
    <div class="form_wrap">
      <input type="text" v-model="city_name"> 
      <button @click="toSearch">查询</button>
    </div>
  </div>
</template>

<script>
export default {
  name: '2209vueWeaForm',

  data() {
    return {
      city_name:"" //城市名
    };
  },

  mounted() {
    
  },

  methods: {
    toSearch(){
      // 完成子传父 给父组件传递城市名
      this.$emit("sendcity",this.city_name)
    }
  },
};
</script>
<style lang="less" scoped>
    .form_wrap{
      width:800px;
      margin:20px auto;
      display:flex;
      input{
        width:80%;
        height:50px;
      }
      button{
        width:120px;
        background:skyblue;
      }
    }
</style>